1. Field of the Invention
The present invention relates to edge detection, and more specifically, to an edge detection apparatus for detecting a Bayer pattern and a computing circuit employed in the edge detection apparatus.
2. Description of the Prior Art
Bayer pattern color filter arrays are widely applied to image sensors of image-capturing devices for filtering color information of light emitted from the captured object. Please refer to FIG. 1. FIG. 1 is a color filter arrangement diagram of a Bayer pattern color filter array 10. The Bayer pattern color filter array 10 includes a plurality of patterns 12 arrayed in a matrix. Each pattern 12 includes three kinds of color filters arrayed in a 2×2 matrix. The three kinds of color filters are a red color filter, a blue color filter, and a green color filter. As shown in FIG. 1, “R” symbolizes the red color filter, “G” symbolizes the green color filter, and “B” symbolizes the blue color filter. Each pattern 12 comprises one red color filter, one blue color filter, and two green color filters based on the fact that the human visual system is more sensitive to the green color information than to the red and blue information. The two green color filters are positioned in a diagonal configuration instead of being positioned close to each other. The red color filter and the blue color filter are therefore also positioned in a diagonal configuration.
The imaging system obtains raw sensory data having less color samples per pixel because it ignores the other two color components for each pixel. Since each filter of the color filter array covers a single pixel and only allows a color in a specific spectral band to pass, before the scene image is further processed or displayed, the missing colors of each image pixel must be reconstructed so that each image pixel contains all three color components. The conventional color interpolation method uses replication of the values of the nearest neighboring image pixels, or alternatively uses linear or logarithmic averaging techniques for obtaining an average value of the neighboring image pixels for reconstructing the missing color. The color interpolation process to convert raw sensory image data into a full color image by estimating the missing color components of each image pixel from its neighboring image pixels is well known to those skilled in the art as “demosaicing”. Due to the aliasing effects caused by averaging (low-pass filtering) pixel values across the edges, most demosaicing approaches often introduce image effect problems, such as zipper effects, false colors, or blurred edges of the image where there are dense edges.
In order to solve the above-mentioned problems, the conventional approach performs an edge detection upon the image, where the edge detection is utilized for determining if a pixel corresponds to the edge of the image, and for determining the edge direction and the degree of the edge variation, and then performs interpolation according to the detecting result. For a Bayer pattern, the edge detection filter needs to generate constant detecting results when the detected pixels are moved along the edge direction, therefore, many edge detection filters are not suitable for the Bayer pattern. A Sobel filter is one kind of filter utilized for Bayer pattern edge detecting, which can determine whether a pixel corresponds to a horizontal edge or a vertical edge. Generally, the Sobel filter can determine the edge directions correctly; however, the Sobel filter might determine a wrong direction in a case where noise of the detected image is significant; moreover, the Sobel filter might fail to correctly determine the edge in the slightly blurred region. In an image scaling operation, a reliable edge detection approach is required to improve the scaled image quality. Thus, there is a need for increasing the accuracy and reliability of edge detection.